#include"passwordConversion.h"

char* passwordConversion(char* password,int key)
{
	//if (password == NULL) return NULL;
	assert(password);
	char* p = password;
	while (*p != '\0')
	{
		if (*p >= '0' && *p <= '9')
		{
			*p = '0' + (*p - '0' + key % 10 + 10) % 10;
		}
		else if (*p >= 'a' && *p <= 'z')
		{
			*p = 'a' + (*p - 'a' + key % 26 + 26) % 26;
		}
		else if (*p >= 'A' && *p <= 'Z')
		{
			*p = 'A' + (*p - 'A' + key % 26 + 26) % 26;
		}
		p++;
	}
	return password;
}